﻿<h3>New Topic</h3>
<form name="newTopicForm" novalidate ng-submit="save()">
    <fieldset>
        <div class="col-md-pull-3">
            <label for="title" class="col-md-pull-1">Title</label>
            <br />
            <input name="title" type="text" ng-model="newTopic.title" required ng-minlength="5"/>
            <span class="error" ng-show="newTopicForm.title.$error.required">*</span>
            <span class="error" ng-show="newTopicForm.title.$error.minlength">Minimum 5 character</span>
        </div>
        <div class="col-md-pull-3">
            <label for="body" class="col-md-pull-1">Body</label>
            <br />
            <textarea name="body" rows="5" cols="30" ng-model="newTopic.body" required ng-minlength="15"/>
            <span class="error" ng-show="newTopicForm.body.$error.required">*</span>
            <span class="error" ng-show="newTopicForm.body.$error.minlength">Minimum 15 character</span>
        </div>
        <div>
            <input type="submit" class="btn btn-default btn-sm" value="save" ng-disabled="newTopicForm.$invalid" />
            <a href="#/" class="btn btn-primary btn-sm">Cancel</a>
        </div>
    </fieldset>
</form>
